---
name: useColorKnob
menu: Knobs
route: /use-color-knob
---

import { Playground } from "docz";
import { Inspector, useColorKnob } from "../../src/lib";

### useColorKnob(label, value)

Shows color picker in the inspector. Returns the color value in hex. Also returns a method to set the color.

- `label` - A label for the color picker
- `value` - A color (string or hex value) as initial value

#### Usage

```javascript
import { useColorKnob } from "retoggle";
```

<Playground>
{() => {
    const [color, setColor] = useColorKnob("Color", "green");

    return (
        <React.Fragment>
            <Inspector usePortal={false} />
            {color}
        </React.Fragment>
    )

}}

</Playground>
